<?php $this->load->view('admin/_header2') ?>

<table id="tt" class="easyui-datagrid" style="width:970px;height:auto;"> >
	<thead>
	<tr height=32 >
		<th field="name0" align=center  width=30 ></th>
		<th field="name1" align=center  width=140 >AgencyCode</th>
		<th field="name2" align=center  width=120>Name</th>
		<th field="name3" align=center  width=120 >Tel</th>
		<th field="name4" align=center  width=140>contact</th>
		<th field="name5" align=center  width=80>ServiceType</th>
		<th field="name6" align=center  width=100 >AuthorizedKey</th>
		<th field="name7" align=center  width=150></th>
	</tr>
	</thead>
	<tbody>
	<?php
	
	$index=0;
	foreach($agentResult as $item)
	{
		$index++;
	?><tr align=center >
		<td><?=$index?></td>
		<td><?=$item->AgencyCode ?></td>
		<td><?=$item->Name ?></td>
		<td><?=$item->Tel ?></td>
		<td><?=$item->contact  ?></td>
		<td><?=$item->ServiceType ?></td>
		<td><?=$item->AuthorizedKey ?></td>
		<td><a href=# style="color:orange" onclick="return editagent('<?=$item->userid?>');" >edit<a/></td>
	</tr>
	<?php
	}
	?></tbody>
</table>

<div id="addwin" class="easyui-window" title="edit Agent" closed="true" iconCls="icon-edit" style="width:680px;height:450px;padding:0px;background: #fafafa;">
	<div class="easyui-layout" fit="true">
		<div id="dvcontext" region="center" border="false" style="padding:10px;background:#fff;border:1px solid #ccc;">
			<iframe id="ifrawin" name="editcontext" src="" width=100% height=100% frameborder=0 ></iframe>
		</div>
	</div>
</div>

<script language="javascript">
	//编辑客户	
	function editagent(userid)
	{
		gd$("ifrawin").src="<?=site_url('admin/agent/editagent')?>/"+userid;
		$("#addwin").window({title:"edit agent"}).window('open');
		return false;
	}
</script>
<?php $this->load->view('admin/_footer1') ?>